package com.itheima.health;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;

/**
 * @author cfr
 * @date 2021/12/28
 * @TIME:11:31
 */
@Slf4j
@SpringBootApplication
@MapperScan("com.itheima.health.mapper")
@ServletComponentScan("com.itheima.health.filter")
public class HealthApplication {
    public static void main(String[] args) {
        SpringApplication.run(HealthApplication.class,args);
        log.info("项目启动成功...");
    }
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
        mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return mybatisPlusInterceptor;
    }
}
